package com.ems.model;

import java.util.Date;

public class Attendance {
    private int attendanceId;
    private String empId;
    private String empName;
    private Date recordDate;
    private String status;
    private String leaveReason;

    // 添加构造函数
    public Attendance() {}

    public Attendance(int attendanceId, String empId, String empName,
                      Date recordDate, String status, String leaveReason) {
        this.attendanceId = attendanceId;
        this.empId = empId;
        this.empName = empName;
        this.recordDate = recordDate;
        this.status = status;
        this.leaveReason = leaveReason;
    }

    public Attendance(int attendanceId, String empId, java.sql.Date recordDate, String status, String leaveReason) {
    }

    // Getters and Setters
    public int getAttendanceId() { return attendanceId; }
    public void setAttendanceId(int attendanceId) {this.attendanceId = attendanceId;}
    public String getEmpId() { return empId; }
    public void setEmpId(String empId) { this.empId = empId; }
    public String getEmpName() { return empName; }
    public void setEmpName(String empName) { this.empName = empName; }
    public Date getRecordDate() { return recordDate; }
    public void setRecordDate(Date recordDate) { this.recordDate = recordDate; }
    public String getStatus() {
        return status != null ? status : "";
    }
    public void setStatus(String status) { this.status = status; }
    public String getLeaveReason() {
        return leaveReason != null ? leaveReason : "";
    }
    public void setLeaveReason(String leaveReason) { this.leaveReason = leaveReason; }

    @Override
    public String toString() {
        return "Attendance{" +
                "attendanceId=" + attendanceId +
                ", empId='" + empId + '\'' +
                ", empName='" + empName + '\'' +
                ", recordDate=" + recordDate +
                ", status='" + status + '\'' +
                ", leaveReason='" + leaveReason + '\'' +
                '}';
    }
}
